package com.czhong.rmi.server;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by DELL on 2017/2/18.
 */
public class UserImpl extends UnicastRemoteObject implements User {

    private Map<String, Integer> userAge;

    public UserImpl() throws RemoteException{
        userAge = new HashMap<>();
        userAge.put("Zhong",25);
        userAge.put("Wu",22);
    }
    public int getAge(String name) throws RemoteException{

        return userAge.get(name);
    }
}
